

DROP procedure IF EXISTS `ResetPasswordRequest`;



DELIMITER $$

USE `ft1`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `ResetPasswordRequest`(IN p_email varchar(200),IN p_newPassword varchar(45), out p_fullName varchar(200), out statusCode varchar(2))

BEGIN



if p_email in (select `email` from `users`) then



set statusCode = '0';



UPDATE `users`

SET `password` = MD5(p_newPassword)

WHERE `email`= p_email;

select `fullName` into  p_fullName from `users` WHERE `email`= p_email;

else 



set statusCode = '1';



end if;



END

$$



DELIMITER ;



